﻿// Decompiled with JetBrains decompiler
// Type: 我的小工具.Dog
// Assembly: 开发辅助工具, Version=1.0.0.1, Culture=neutral, PublicKeyToken=null
// MVID: F78E5980-5E94-4E46-ABDF-DC8C6CBF52AA
// Assembly location: K:\Tools\工具\开发辅助工具庆六一版\开发辅助工具2015-06-01\开发辅助工具.exe

using System;
using System.Runtime.InteropServices;

namespace 我的小工具
{
  internal class Dog
  {
    public int DogBytes = 0;
    public int DogAddr = 1;
    public int DogCascade = 0;
    public int NewCascade = 0;
    public int DogPassword = 352476381;
    public int NewPassword = 0;
    public int DogResult = 0;
    public int CurrentNu = 0;
    public byte[] DogData = new byte[200];
    public int RetCode = 0;
    private Dog.dCheck_Dog entCheck_Dog;
    private Dog.dRead_Dog entRead_Dog;
    private Dog.dWrite_Dog entWrite_Dog;
    private Dog.dConvert_Dog entConvert_Dog;
    private Dog.dDisableShare_Dog entDisableShare_Dog;
    private Dog.dSetPassword_Dog entSetPassword_Dog;
    private Dog.dSetCascade_Dog entSetCascade_Dog;
    private Dog.dGetCurrentNo_Dog entGetCurrentNo_Dog;

    public Dog()
    {
      if (IntPtr.Size == 4)
      {
        this.entCheck_Dog = new Dog.dCheck_Dog(Dog.Check_Dog32);
        this.entRead_Dog = new Dog.dRead_Dog(Dog.Read_Dog32);
        this.entWrite_Dog = new Dog.dWrite_Dog(Dog.Write_Dog32);
        this.entConvert_Dog = new Dog.dConvert_Dog(Dog.Convert_Dog32);
        this.entDisableShare_Dog = new Dog.dDisableShare_Dog(Dog.DisableShare_Dog32);
        this.entSetPassword_Dog = new Dog.dSetPassword_Dog(Dog.SetPassword_Dog32);
        this.entSetCascade_Dog = new Dog.dSetCascade_Dog(Dog.SetCascade_Dog32);
        this.entGetCurrentNo_Dog = new Dog.dGetCurrentNo_Dog(Dog.GetCurrentNo_Dog32);
      }
      else
      {
        this.entCheck_Dog = new Dog.dCheck_Dog(Dog.Check_Dog64);
        this.entRead_Dog = new Dog.dRead_Dog(Dog.Read_Dog64);
        this.entWrite_Dog = new Dog.dWrite_Dog(Dog.Write_Dog64);
        this.entConvert_Dog = new Dog.dConvert_Dog(Dog.Convert_Dog64);
        this.entDisableShare_Dog = new Dog.dDisableShare_Dog(Dog.DisableShare_Dog64);
        this.entSetPassword_Dog = new Dog.dSetPassword_Dog(Dog.SetPassword_Dog64);
        this.entSetCascade_Dog = new Dog.dSetCascade_Dog(Dog.SetCascade_Dog64);
        this.entGetCurrentNo_Dog = new Dog.dGetCurrentNo_Dog(Dog.GetCurrentNo_Dog64);
      }
    }

    [DllImport("htbdog.dll", EntryPoint = "Check_Dog", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern int Check_Dog32(int DogCascade, int DogPassword, ref int RetCode);

    [DllImport("htbdog.dll", EntryPoint = "Read_Dog", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern int Read_Dog32(int DogCascade, int DogPassword, int DogAddr, int DogBytes, byte[] DogData, ref int RetCode);

    [DllImport("htbdog.dll", EntryPoint = "Write_Dog", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern int Write_Dog32(int DogCascade, int DogPassword, int DogAddr, int DogBytes, byte[] DogData, ref int RetCode);

    [DllImport("htbdog.dll", EntryPoint = "Convert_Dog", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern int Convert_Dog32(int DogCascade, int DogPassword, int DogBytes, byte[] DogData, ref int DogResult, ref int RetCode);

    [DllImport("htbdog.dll", EntryPoint = "DisableShare_Dog", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern int DisableShare_Dog32(int DogCascade, int DogPassword, ref int RetCode);

    [DllImport("htbdog.dll", EntryPoint = "SetPassword_Dog", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern int SetPassword_Dog32(int DogCascade, int DogPassword, int NewPassword, ref int RetCode32);

    [DllImport("htbdog.dll", EntryPoint = "SetCascade_Dog", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern int SetCascade_Dog32(int DogCascade, int DogPassword, int NewCascade, ref int RetCode);

    [DllImport("htbdog.dll", EntryPoint = "GetCurrentNo_Dog", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern int GetCurrentNo_Dog32(int DogCascade, ref int CurrentNu, ref int RetCode);

    [DllImport("htbdog64.dll", EntryPoint = "Check_Dog", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern int Check_Dog64(int DogCascade, int DogPassword, ref int RetCode);

    [DllImport("htbdog64.dll", EntryPoint = "Read_Dog", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern int Read_Dog64(int DogCascade, int DogPassword, int DogAddr, int DogBytes, byte[] DogData, ref int RetCode);

    [DllImport("htbdog64.dll", EntryPoint = "Write_Dog", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern int Write_Dog64(int DogCascade, int DogPassword, int DogAddr, int DogBytes, byte[] DogData, ref int RetCode);

    [DllImport("htbdog64.dll", EntryPoint = "Convert_Dog", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern int Convert_Dog64(int DogCascade, int DogPassword, int DogBytes, byte[] DogData, ref int DogResult, ref int RetCode);

    [DllImport("htbdog64.dll", EntryPoint = "DisableShare_Dog", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern int DisableShare_Dog64(int DogCascade, int DogPassword, ref int RetCode);

    [DllImport("htbdog64.dll", EntryPoint = "SetPassword_Dog", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern int SetPassword_Dog64(int DogCascade, int DogPassword, int NewPassword, ref int RetCode64);

    [DllImport("htbdog64.dll", EntryPoint = "SetCascade_Dog", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern int SetCascade_Dog64(int DogCascade, int DogPassword, int NewCascade, ref int RetCode);

    [DllImport("htbdog64.dll", EntryPoint = "GetCurrentNo_Dog", CharSet = CharSet.Ansi, SetLastError = true)]
    public static extern int GetCurrentNo_Dog64(int DogCascade, ref int CurrentNu, ref int RetCode);

    public int Check_Dog(int DogCascade, int DogPassword, ref int RetCode)
    {
      return this.entCheck_Dog(DogCascade, DogPassword, ref RetCode);
    }

    public int Read_Dog(int DogCascade, int DogPassword, int DogAddr, int DogBytes, byte[] DogData, ref int RetCode)
    {
      return this.entRead_Dog(DogCascade, DogPassword, DogAddr, DogBytes, DogData, ref RetCode);
    }

    public int Write_Dog(int DogCascade, int DogPassword, int DogAddr, int DogBytes, byte[] DogData, ref int RetCode)
    {
      return this.entWrite_Dog(DogCascade, DogPassword, DogAddr, DogBytes, DogData, ref RetCode);
    }

    public int Convert_Dog(int DogCascade, int DogPassword, int DogBytes, byte[] DogData, ref int DogResult, ref int RetCode)
    {
      return this.entConvert_Dog(DogCascade, DogPassword, DogBytes, DogData, ref DogResult, ref RetCode);
    }

    public int DisableShare_Dog(int DogCascade, int DogPassword, ref int RetCode)
    {
      return this.entDisableShare_Dog(DogCascade, DogPassword, ref RetCode);
    }

    public int SetPassword_Dog(int DogCascade, int DogPassword, int NewPassword, ref int RetCode)
    {
      return this.entSetPassword_Dog(DogCascade, DogPassword, NewPassword, ref RetCode);
    }

    public int SetCascade_Dog(int DogCascade, int DogPassword, int NewCascade, ref int RetCode)
    {
      return this.entSetCascade_Dog(DogCascade, DogPassword, NewCascade, ref RetCode);
    }

    public int GetCurrentNo_Dog(int DogCascade, ref int CurrentNu, ref int RetCode)
    {
      return this.entGetCurrentNo_Dog(DogCascade, ref CurrentNu, ref RetCode);
    }

    private delegate int dCheck_Dog(int DogCascade, int DogPassword, ref int RetCode);

    private delegate int dRead_Dog(int DogCascade, int DogPassword, int DogAddr, int DogBytes, byte[] DogData, ref int RetCode);

    private delegate int dWrite_Dog(int DogCascade, int DogPassword, int DogAddr, int DogBytes, byte[] DogData, ref int RetCode);

    private delegate int dConvert_Dog(int DogCascade, int DogPassword, int DogBytes, byte[] DogData, ref int DogResult, ref int RetCode);

    private delegate int dDisableShare_Dog(int DogCascade, int DogPassword, ref int RetCode);

    private delegate int dSetPassword_Dog(int DogCascade, int DogPassword, int NewPassword, ref int RetCode32);

    private delegate int dSetCascade_Dog(int DogCascade, int DogPassword, int NewCascade, ref int RetCode);

    private delegate int dGetCurrentNo_Dog(int DogCascade, ref int CurrentNu, ref int RetCode);
  }
}
